package thread.demo.queue;

import java.util.concurrent.ArrayBlockingQueue;

public class ArrayBlockingQueue_Offer {
  public static void main(String[] args) {
    ArrayBlockingQueue<Integer> queue = new ArrayBlockingQueue<>(2);
    
    System.out.println(queue.offer(1));
    System.out.println(queue.offer(2));
    
    // 如果添加失败后，直接返回false
    System.out.println(queue.offer(3));
  }
}
